﻿/*
 * Cratos Desktop
 * Cratos Proxy Base class
 * 
 * Copyright (c) 2011 Draco
 * 
 * This file is part of Cratos.
 * 
 * Cratos is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * Cratos is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Cratos.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *       .==.        .==.
 *      //'^\\      //^'\\
 *     // ^ ^\(\__/)/^ ^^\\
 *    //^ ^^ ^/6  6\ ^^ ^ \\
 *   //^ ^^ ^/( .. )\^ ^ ^ \\
 *  // ^^ ^/\| V""V|/\^ ^ ^ \\
 * //^^/\/ /  '~~'  \ \/\^ ^ \\
 *  ------------------------------------
 *  HERE BE DRAGONS
 *  
 *  Johan Dercksen - johan@draco.co.za
 */
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Collections.ObjectModel;

using Cratos.Tools.General;
using Cratos.Tools.DataObject;

namespace Cratos.Desktop
{
	/// <summary>
	/// Cratos Proxy Base class
	/// </summary>
	public abstract class CratosProxyBase
	{
		#region Class Constant declarations
		#endregion

		#region Class Event declarations
		#endregion

		#region Class Variable declarations
		private bool										ignoreCache = false;
		private Collection<CratosError> proxyErrors = new Collection<CratosError>();
		#endregion

		#region Class Constructors & Destructors
		/// <summary>
		/// Class Constructor
		/// </summary>
		public CratosProxyBase()
		{
			// Set the WCF Service URL if required
			if (!IsUrlSet)
			{
				CWcfService.WcfServiceUri     = DOCratosGlobal.WcfServiceAddress;
				CDualWcfService.WcfServiceUri = DOCratosGlobal.DualWcfServiceAddress;
				IsUrlSet                      = true;
			}
		}
		#endregion

		#region Class Properties
		/// <summary>
		/// URL Set indicator
		/// </summary>
		public static bool IsUrlSet { get; set; }

		/// <summary>
		/// Ignore Unity indicator
		/// </summary>
		public bool IgnoreUnity { get; set; }

		/// <summary>
		/// Cratos Entity Error Collection
		/// </summary>
		public Collection<CratosError> Errors
		{
			get { return (this.proxyErrors); }
		}

		/// <summary>
		/// Ignore Cache indicator
		/// </summary>
		public bool IgnoreCache
		{
			get { return (this.ignoreCache); }
			set { this.ignoreCache = value; }
		}
		#endregion

		#region Class Methods
		#endregion

		#region Class Support Methods
		#endregion
	}
}
